/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package clases.pe.edu;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author Evelin
 */
public class DBConection {
    public Connection getConnection() {
		Connection con = null;
		String driverDataBase="oracle.jdbc.driver.OracleDriver";
		String urlDataBase="jdbc:oracle:oci8:@localhost:1521:XE";
		String userDataBase="usuario";
		String passwordDataBase="oracle";

		
		try {
			Class.forName(driverDataBase).newInstance();
			con = DriverManager.getConnection(urlDataBase, userDataBase, passwordDataBase);
			
		} catch ( Exception e) {
			System.out.println("* * * Ocurrio un ERROR con la conexion " + e.getLocalizedMessage() );
			e.printStackTrace();
		}
		
		return con;
		
	}
}
